package com.example.shop_2304.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
@Dao
interface HistoryDao {
    //新增
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(historyEntity: HistoryEntity)
    //查询
    @Query("select * from history where phone = :phone")
    fun query(phone:String):MutableList<HistoryEntity>
    //删除
    @Delete
    fun delete(historyEntity: HistoryEntity)
    //批量删除
    @Query("delete from history")
    fun deleteAll()
}